﻿import request from '/@/utils/request';
enum Api {
  AddHouse = '/api/house/add',
  DeleteHouse = '/api/house/delete',
  UpdateHouse = '/api/house/update',
  PageHouse = '/api/house/page',
  DetailHouse = '/api/house/detail',
  GetFloorfloorIdDropdown = '/api/house/FloorfloorIdDropdown',
  GetUnitunitIdDropdown = '/api/house/UnitunitIdDropdown',
  GetCommunityCommunityIdDropdown = '/api/house/CommunityCommunityIdDropdown',
  GetBuildingsbuildingsIdDropdown = '/api/house/BuildingsbuildingsIdDropdown',
  GetTree = '/api/house/GetTree',
  Card='/api/house/getCard',
  peoplenum='/api/house/PeopleNum'
}

// 增加房间
export const addHouse = (params?: any) =>
    request({
        url: Api.AddHouse,
        method: 'post',
        data: params,
    });

// 删除房间
export const deleteHouse = (params?: any) => 
    request({
            url: Api.DeleteHouse,
            method: 'post',
            data: params,
        });

// 编辑房间
export const updateHouse = (params?: any) => 
    request({
            url: Api.UpdateHouse,
            method: 'post',
            data: params,
        });

// 分页查询房间
export const pageHouse = (params?: any) => 
    request({
            url: Api.PageHouse,
            method: 'post',
            data: params,
        });

// 详情房间
export const detailHouse = (id: any) => 
    request({
            url: Api.DetailHouse,
            method: 'get',
            data: { id },
        });
//楼层
export const getFloorfloorIdDropdown = (id:any) =>
        request({
        url: Api.GetFloorfloorIdDropdown,
        method: 'post',
        data:{
            id:id||0
        },
        });
//单元
export const getUnitunitIdDropdown = (id:any) =>
        request({
        url: Api.GetUnitunitIdDropdown,
        method: 'post',
        data:{
            id:id||0
        },
        });
//楼栋
export const getBuildingsbuildingsIdDropdown = (id:any) =>
        request({
        url: Api.GetBuildingsbuildingsIdDropdown,
        method: 'post',
        data:{
            id:id||0
        },
        });
//小区
export const getCommunityCommunityIdDropdown = () =>
        request({
        url: Api.GetCommunityCommunityIdDropdown,
        method: 'get',
        });
//小区树形
export const GetTree1=()=>

	    request({
        url: Api.GetTree,
        method: 'get',
        });
export const getCard=()=>

	    request({
        url: Api.Card,
        method: 'get',
        });
        
export const peoplenum1=()=>
request({
    url: Api.peoplenum,
    method: 'get',
    });

